This invention relates to the field of machine vision, and its application in obtaining an optimally focused image of an object under analysis. Specifically, the invention addresses a need for obtaining a properly focused image under high magnification of a portion of a surface. The invention is suitable for the inspection of transparent and/or translucent surfaces, and surfaces that are not coplanar, though, it can be used to inspect the surface of virtually any object.
Inspection operations in an industrial environment are typically performed to characterize manufacturing operations, and to ensure that quality and product specification requirements are met. Many inspection operations can be extremely tedious for human operators performing manual inspection, and the application of machine vision is typically used to improve the consistency and accuracy of an inspection operation, while relieving an inspection operator from performing the task. For example, the application of machine vision-assisted inspection of fiber optic cable assemblies has recently been the subject of much development.
Fiber optic cable assembly operations require the inspection of fiber optic cable end faces to ensure that fiber connections do not degrade optical signal transmission. Scratches, cracks, and debris on critical areas of the interconnection interface may result in defective operation, or result in a degradation of performance. High-magnification inspection of the fiber end face is typically performed during assembly to inspect the condition and cleanliness of the fiber.
Inspection of the end face of a fiber optic cable is inherently difficult because of the properties and characteristics of the fiber. The regions of the fiber end face that require inspection are generally transparent, and exhibit low contrast of features when imaged for machine vision applications. The transparent nature of the fiber optic cable contributes to difficult lighting conditions since illumination intended for inspection of the surface also enters the fiber, and may reflect back into the machine vision system causing image noise. Moreover, images of similar fiber ends typically appear significantly different under identical lighting conditions.
Automation of the inspection of fiber optic cable end faces using machine vision improves inspection efficiency, and to minimizes or avoids the subjectivity of human assessment. Effective implementation of machine vision in an automated inspection process requires a properly focused image of the area under analysis. Manually focused, fiber end face images are subject to human inspection error and result in unrepeatable results. For example, scratches, pits, and other defects appear brighter and/or larger when the image is out of focus, since the features of the potential defect are blurred, which may result in a false rejection of an otherwise acceptable fiber. Therefore, an automated inspection process having an automatic focus mechanism is preferred for uniform, and optimal results.
The prior art suggests the use of an image sharpness measurement to attain an optimal focus setting for an inspection operation of a planar optical fiber end face surface. This has been done by searching through several images at various focus settings and measuring a gradient magnitude of features, such as the fiber boundary and other features, in each image, and calculating a sharpness response. Selecting the focus setting so as to obtain a maximum sharpness response results in an optimal focus setting for the found features. However, the surface of a fiber end face in the current state of the art is not typically planar. Proper focus settings for fiber boundary features will not result in an optimal focus setting for the entire non-planar fiber surface.
Characteristics of a transparent, non-planar surface, such as a non-planar fiber optic end face, present additional challenges to focusing the image for inspection. Defects, such as scratches and contamination, are not visible when the image is out of focus. A narrow depth of field at high magnifications further complicates the inspection process since regions of an image may appear to be properly focused while other portions of the image exhibit improper focus. The sharpness response for fine, non-structural features, is extremely narrow, to the extent that a focus adjustment increment must be extremely small in order to detect a perceptible change in the sharpness response. Such small focus adjustment increments are difficult and often not possible for a human operator to perform in a manner that is consistent, reliable, and not subject to variable human interpretation.
In one general aspect of the present invention, a method is provided for determining an optimal focus setting of an optical imaging system comprising a coarse focus, followed by a fine focus. The coarse focus is attained by providing an image of an object under inspection through a range of possible focus settings, and measuring a sharpness response of the image. The coarse focus setting is determined when the sharpness response is measured to be at a maximum value. The fine focus is attained by starting at the coarse focus setting, and providing an image of the object under inspection through a range of possible fine focus settings, and measuring the fine feature sharpness response. The fine feature sharpness response can be determined from a portion of the image for which the optimal focus setting is desired. The optimal focus setting is determined when the fine feature sharpness response is measured to be at a maximum value.
In accordance with another aspect of the invention, the method for determining an optimal focus setting can be applied to the inspection of a fiber optic end face. The coarse focus setting can be best determined by finding the interface between layers in the fiber, which appear as an annular feature in the image, and measuring an edge characteristic, such as by applying a caliper tool to the feature in the image, to measure sharpness.
A further aspect of the invention measures coarse feature sharpness using sub-pixel boundary gradient magnitude of features associated with overall structure of the object under inspection. Sub-pixel boundary gradient magnitude can be easily determined by running conventional edge detection techniques commonly used in machine vision.
A still further aspect of the invention measures fine feature sharpness by associating a sharpness measurement to the amount of image detail present in the portion of the image for which the optimal focus setting is desired. This can also be determined by transforming the image into frequency space, and measuring the density of high frequency elements through the application of a band pass filter.
A still further aspect of the invention contemplates the use of more than one image of the object at a particular focus setting for the calculation of the sharpness measurement. A sharpness measurement can be determined by comparing the multiple images.
As another aspect of the invention, an apparatus for focusing an optical inspection system comprises a camera, an object of inspection, a focus adjusting mechanism, and a machine vision processor, for carrying out the method of the present invention. The machine vision processor has a coarse feature sharpness measuring capability for measuring coarse feature sharpness of the overall structure of the object of inspection, that cooperates with the focus adjusting mechanism. The machine vision processor has a fine feature sharpness measuring capability for measuring fine feature sharpness of the surface of the object of inspection, also cooperative with the focus adjusting mechanism. The machine vision processor has a signaling capability for indicating maximum values for the coarse feature sharpness measurement and the fine feature sharpness measurement.
Still other advantages of the present invention will become readily apparent to those skilled in the art from the following detailed description. As will be realized, the invention is capable of other and different embodiments, and its several details are capable of modifications in various obvious respects, all without departing from the invention. Accordingly, the drawing and description are to be regarded as illustrative in nature, and not as restrictive.